WPS Office.apk(点击下载) / giy.java


package defpackage;

import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
import android.widget.TextView;
import cn.wps.moffice.common.beans.RoundRectImageView;
import cn.wps.moffice.main.push.explore.PushTipsWebActivity;
import cn.wps.moffice_eng.R;
import com.fasterxml.jackson.core.util.MinimalPrettyPrinter;
import java.util.HashMap;
import java.util.List;

/* renamed from: giy  reason: default package */
public final class giy implements View.OnClickListener {
    public int cBX;
    public int cEz;
    public LinearLayout dnK;
    public HorizontalScrollView hep;
    public List<gix> heq;
    public int her = this.mContext.getResources().getDimensionPixelSize(R.dimen.home_search_subject_view_height);
    public int hes = this.mContext.getResources().getDimensionPixelSize(R.dimen.home_search_subject_view_top_padding);
    public int het = this.mContext.getResources().getDimensionPixelSize(R.dimen.home_search_subject_view_bottom_padding);
    private int heu = this.mContext.getResources().getDimensionPixelSize(R.dimen.home_search_subject_view_shrink_padding);
    public Context mContext;

    public giy(Context context) {
        this.mContext = context;
        this.cEz = context.getResources().getDimensionPixelSize(R.dimen.home_template_item_padding);
    }

    public View a(gix gix, boolean z, int i) {
        int i2;
        int i3;
        int i4;
        View inflate = LayoutInflater.from(this.mContext).inflate(R.layout.home_search_subject_item_view, (ViewGroup) this.dnK, false);
        View findViewById = inflate.findViewById(R.id.subject_item_child);
        RoundRectImageView roundRectImageView = (RoundRectImageView) inflate.findViewById(R.id.image);
        roundRectImageView.setRadius((float) this.mContext.getResources().getDimensionPixelSize(R.dimen.home_search_subject_radius));
        dry.bt(this.mContext).li(gix.image_url).A(R.drawable.ic_banner_default, false).a(roundRectImageView);
        ((TextView) inflate.findViewById(R.id.title)).setText(gix.title);
        ((TextView) inflate.findViewById(R.id.views)).setText(this.mContext.getString(R.string.public_search_subject_views) + MinimalPrettyPrinter.DEFAULT_ROOT_VALUE_SEPARATOR + gix.views);
        ((TextView) inflate.findViewById(R.id.template_nums)).setText(this.mContext.getString(R.string.public_search_subject_template_nums) + MinimalPrettyPrinter.DEFAULT_ROOT_VALUE_SEPARATOR + gix.hen);
        int i5 = this.mContext.getResources().getDisplayMetrics().widthPixels;
        if (z) {
            i2 = i5 - (this.cEz << 1);
            i3 = i5;
            i4 = this.cEz;
        } else {
            int i6 = i5 - this.heu;
            i2 = i6 - this.cEz;
            if (i == 0) {
                i3 = i6;
                i4 = this.cEz;
            } else {
                int i7 = this.cEz / 2;
                i3 = i6 - (this.cEz / 2);
                i4 = i7;
            }
        }
        ViewGroup.LayoutParams layoutParams = inflate.getLayoutParams();
        layoutParams.width = i3;
        inflate.setLayoutParams(layoutParams);
        ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) findViewById.getLayoutParams();
        marginLayoutParams.width = i2;
        marginLayoutParams.leftMargin = i4;
        findViewById.setLayoutParams(marginLayoutParams);
        findViewById.setOnClickListener(this);
        findViewById.setTag(Integer.valueOf(i));
        return inflate;
    }

    public final void onClick(View view) {
        Object tag = view.getTag();
        if (tag instanceof Integer) {
            int parseInt = Integer.parseInt(String.valueOf(tag));
            gix gix = this.heq.get(parseInt);
            Intent intent = new Intent(this.mContext, PushTipsWebActivity.class);
            intent.putExtra(hbe.frL, "https://android.wps.cn/2017/zt/template-ppt/index-buy.html?mbId=" + gix.heo + "&location=search");
            this.mContext.startActivity(intent);
            HashMap hashMap = new HashMap();
            hashMap.put("name", gix.title);
            hashMap.put("position", String.valueOf(parseInt + 1));
            gmz.a("specialsearchresult_click", this.cBX, hashMap);
        }
    }
}